<template>
    
    <!-- 组件的模板 -->
    <div class="page download">
        <span class="icon-download"></span>
        <h2>{{title}}</h2>
        <p class="time">{{export_time}}</p>
        <div class="btn-box">
            <a href="javascript:;" class="weui-btn weui-btn_primary" @click="downloadExcel">获取明细</a>
        </div>
    </div>  
</template>

<script>
    /**
     *  引入工具类库 或 Native API
     *  example : import widget from 'gapi/widget'
     */
    import clientUi from 'gapi/clientUi'
    import * as util from 'js/util.js'
    /**
     *  引入组件 以及 组件接口(Action)
     *  example : import Somecomponents from 'components/Somecomponents/Somecomponents'
     */

    /**
     *  组件实例对象
     */
    export default {
        components: {

        },
        data: function(){
            return{
                download_url: '',
                title: '',
                export_time: ''
            }
        },
        vuex: {
            getters: {

            },
            actions: {

            }
        },
        methods: {
            /**
             * 初始化
             * @method init
             * @public
             * @return {Null} void
             */
            init (){
                // alert(location.href)
                this.export_time = util.getLocalTime(util.getUrddataString('export_time')*1000, 'yyyy-MM-dd HH:mm:ss')
                this.download_url = util.getUrddataString('download_url')
                this.title = util.getUrddataString('title')
                console.log(this.export_time)
                console.log(this.download_url)
                console.log(this.title)
                
            },
            downloadExcel (){
                clientUi.copyDialog('复制明细下载链接', this.download_url, '', '复制', '取消', (data) => {
                    console.log(data.status) // 0 表示用户点击 cancelButton，1 表示用户点击 confirmButton
                })
            }
        },
        created(){

            this.init();
            
        }
        
    }

    
</script>

<!-- CSS 样式 -->
<style src="../../node_modules/weui/dist/style/weui.css"></style>
<style src="../../static/css/common.css"></style>
<style src="../../static/css/attendance.css"></style>



